package com.woniu.service.impl;

import com.woniu.entity.MedicalRoom;
import com.woniu.mapper.MedicalRoomMapper;
import com.woniu.service.MedicalRoomService;
import com.woniu.utils.ResponseEnum;
import com.woniu.utils.ResponseUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: zcy
 * @Create: 2025/10/31 14:41
 */
@Service
public class MedicalRoomServiceImpl implements MedicalRoomService {
    @Resource
    private MedicalRoomMapper medicalRoomMapper;
    @Override
    public ResponseUtil selectAll() {
        List<MedicalRoom> medicalRoomList = medicalRoomMapper.selectAll();
        return medicalRoomList != null ?ResponseUtil.get(ResponseEnum.OK,medicalRoomList)
                : ResponseUtil.get(ResponseEnum.FAIL);
    }
    @Override
    public ResponseUtil findAll() {
        List<MedicalRoom> all = medicalRoomMapper.findAll();
        return !all.isEmpty()?ResponseUtil.get(ResponseEnum.OK,all):ResponseUtil.get(ResponseEnum.FAIL);
    }
}
